cmake_minimum_required(VERSION 3.5) # CMake install : https://cmake.org/download/
project(demos LANGUAGES CXX)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

set(CMAKE_PREFIX_PATH "c:/Qt/6.7.1/mingw_64") # Qt Kit Dir

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# 不要添加两次
aux_source_directory(./demo1 DEMO1)


find_package(Qt6 COMPONENTS Widgets REQUIRED) # Qt COMPONENTS

# include_directories(${Qt6Widgets_INCLUDE_DIRS})
# link_directories(${Qt6Widgets_LIBRARIES})

link_libraries(Qt6::Widgets) # Qt5 Shared Library

add_executable(demo1
    WIN32 # If you need a terminal for debug, please comment this statement 
    ${DEMO1} 
) 

# 建议这样添加demo源文件
add_executable(demo2
    WIN32
   demo2/demo2.cpp
   demo2/demo2.h
   demo2/demo2.ui
   demo2/main.cpp
)